﻿Imports System
Imports System.IO
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
<Serializable()> Public Class ConStandard
    Implements ICloneable
    ''' <summary>
    ''' 对应1  2  3  4  6  8  12  24  month period的标准浓度
    ''' </summary>
    ''' <remarks></remarks>
    Private m_ArrayStand(9) As Double
    ''' <summary>
    ''' 对应1  2  3  4  6  8  12  24  month period的标准浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ArrayStand() As Double()
        Get
            Return Me.m_ArrayStand
        End Get
        Set(ByVal value As Double())
            Me.m_ArrayStand = value
        End Set
    End Property
    ''' <summary>
    ''' 根据不同的平均时间返回对应的背景浓度
    ''' </summary>
    ''' <param name="AverageTime"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function GetCon(ByVal AverageTime As String) As Double
        Select Case AverageTime
            Case "1h"
                Return m_ArrayStand(0)
            Case "2h"
                Return m_ArrayStand(1)
            Case "3h"
                Return m_ArrayStand(2)
            Case "4h"
                Return m_ArrayStand(3)
            Case "6h"
                Return m_ArrayStand(4)
            Case "8h"
                Return m_ArrayStand(5)
            Case "12h"
                Return m_ArrayStand(6)
            Case "24h"
                Return m_ArrayStand(7)
            Case "月平均"
                Return m_ArrayStand(8)
            Case "期间平均"
                Return m_ArrayStand(9)

        End Select
        Return Nothing
    End Function
    Public Function Clone() As Object Implements System.ICloneable.Clone
        Dim obj As New ConStandard
        ReDim obj.m_ArrayStand(Me.m_ArrayStand.Length - 1)
        For i As Integer = 0 To Me.m_ArrayStand.Length - 1
            obj.m_ArrayStand(i) = Me.m_ArrayStand(i)
        Next
        Return obj
    End Function
End Class
